Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle interMedia Java Classes API Reference 10g Release 2 (10.2) Part No. B14301-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ord.im
Class OrdMediaUtil

`java.lang.Object
oracle.ord.im.OrdMediaUtil`

public class OrdMediaUtil
extends java.lang.Object

The OrdMediaUtil class allows other interMedia Java classes to connect to Oracle Database and access data in tables that contain columns of interMedia object types. This class includes methods for downloading and uploading data.

Users of this class should be familiar with Oracle interMedia Reference.

Prerequisites

Before running OrdMediaUtil methods, the following operations must have already been performed:

- A connection has been made to a table that contains columns of the appropriate interMedia object types (OrdAudio, OrdDoc, and so on).
- Local interMedia objects have been created and populated with data.

For examples of making a connection and populating a local object, see Oracle interMedia User's Guide.

Method Summary
`static byte[]` | `getDataInByteArray(oracle.sql.BLOB mediaLobLocator)` Downloads data from a database object to a byte array.
`static boolean` | `getDataInFile(java.lang.String filename, oracle.sql.BLOB mediaLobLocator)` Downloads data from a database object to the specified file.
`static void` | `imCompatibilityInit(oracle.jdbc.OracleConnection con)` Deprecated. This method is no longer needed.
`static void` | `imCompatibilityInit(oracle.jdbc.driver.OracleConnection con)` Deprecated. This method is no longer needed.
`static boolean` | `loadData(java.lang.String filename, oracle.sql.BLOB mediaLobLocator)` Loads data from the specified file to a BLOB.
`static boolean` | `loadDataFromByteArray(byte[] byteArr, oracle.sql.BLOB mediaLobLocator)` Loads data from a byte array to a BLOB.
`static boolean` | `loadDataFromInputStream(java.io.InputStream inStream, oracle.sql.BLOB mediaLobLocator)` Loads data from an InputStream object to a BLOB.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### imCompatibilityInit

    public static void imCompatibilityInit(oracle.jdbc.OracleConnection con)
                                    throws java.lang.Exception

  Deprecated. This method is no longer needed.
  Throws:
    `java.lang.Exception`

### imCompatibilityInit

    public static void imCompatibilityInit(oracle.jdbc.driver.OracleConnection con)
                                    throws java.lang.Exception

  Deprecated. This method is no longer needed.
  Throws:
    `java.lang.Exception`

### loadData

    public static boolean loadData(java.lang.String filename,
                                   oracle.sql.BLOB mediaLobLocator)
                            throws java.sql.SQLException,
                                   java.io.IOException

  Loads data from the specified file to a BLOB.
  Parameters:
    `filename` - the name of the file from which the data is loaded.
    `mediaLobLocator` - the BLOB into which the data is loaded.
  Returns:
    `true` if the load is successful; `false` otherwise.
  Throws:
    `java.sql.SQLException` - if an error occurs accessing an object attribute or executing a method in the database.
    `java.io.IOException` - if an error occurs reading the data file.

### loadDataFromInputStream

    public static boolean loadDataFromInputStream(java.io.InputStream inStream,
                                                  oracle.sql.BLOB mediaLobLocator)
                                           throws java.sql.SQLException,
                                                  java.io.IOException,
                                                  java.lang.OutOfMemoryError

  Loads data from an InputStream object to a BLOB.
  Parameters:
    `inStream` - the name of the `InputStream` object from which the data is loaded.
    `mediaLobLocator` - the BLOB into which the data is loaded.
  Returns:
    `true` if the load is successful; `false` otherwise.
  Throws:
    `java.sql.SQLException` - if an error occurs accessing an object attribute or executing a method in the database.
    `java.io.IOException` - if an error occurs reading the InputStream object.
    `java.lang.OutOfMemoryError` - if sufficient memory cannot be allocated to hold the data.

### loadDataFromByteArray

    public static boolean loadDataFromByteArray(byte[] byteArr,
                                                oracle.sql.BLOB mediaLobLocator)
                                         throws java.sql.SQLException,
                                                java.io.IOException

  Loads data from a byte array to a BLOB.
  Parameters:
    `byteArr` - the name of the `byte []` array from which the data is loaded.
    `mediaLobLocator` - the BLOB into which the data is loaded.
  Returns:
    `true` if the load is successful, `false` otherwise.
  Throws:
    `java.sql.SQLException` - if an error occurs accessing an object attribute or executing a method in the database.
    `java.io.IOException` - if an error occurs reading the byte array.

### getDataInFile

    public static boolean getDataInFile(java.lang.String filename,
                                        oracle.sql.BLOB mediaLobLocator)
                                 throws java.sql.SQLException,
                                        java.io.IOException

  Downloads data from a database object to the specified file.
  Parameters:
    `filename` - the name of the file into which the data is downloaded.
    `mediaLobLocator` - the BLOB from which the data is downloaded.
  Returns:
    `true` if the download is successful; `false` otherwise.
  Throws:
    `java.sql.SQLException` - if an error occurs accessing an object attribute.
    `java.io.IOException` - if an error occurs reading the data from the BLOB or writing the data to the output file.

### getDataInByteArray

    public static byte[] getDataInByteArray(oracle.sql.BLOB mediaLobLocator)
                                     throws java.sql.SQLException,
                                            java.io.IOException,
                                            java.lang.OutOfMemoryError

  Downloads data from a database object to a byte array.
  Parameters:
    `mediaLobLocator` - the BLOB from which data is downloaded, and which returns a byte array containing downloaded data.
  Throws:
    `java.sql.SQLException` - if an error occurs accessing an object attribute.
    `java.io.IOException` - if an error occurs reading the data from the BLOB.
    `java.lang.OutOfMemoryError` - if sufficient memory cannot be allocated to hold the data.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle interMedia Java Classes API Reference 10g Release 2 (10.2) Part No. B14301-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999, 2005, Oracle. All rights reserved.